<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['teacher:book:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['teacher:book:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['teacher:book:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['teacher:book:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table border v-loading="loading" :data="bookList" max-height="1000" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="主键" align="center" prop="recordid" />-->
<!--      <el-table-column label="人员编号" align="center" prop="a00" />-->
      <el-table-column fixed label="著作编号" align="center" prop="itemnumber" width="120"/>
      <el-table-column fixed label="著作名称" align="center" prop="topic" width="200"/>
      <el-table-column label="第一作者类型" align="center" prop="firstauthortype" width="120"/>
      <el-table-column fixed label="第一作者" align="center" prop="firstauthor" width="120"/>
      <el-table-column label="所属单位" align="center" prop="unit" width="180"/>
      <el-table-column label="出版单位" align="center" prop="publishunit" width="120"/>
      <el-table-column label="出版时间" align="center" prop="issuingtime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.issuingtime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="学科门类" align="center" prop="subjectcategories" width="120"/>
      <el-table-column label="一级学科" align="center" prop="firstleveldiscipline" width="150"/>
      <el-table-column label="项目来源" align="center" prop="projectsource" width="120"/>
      <el-table-column label="总字数" align="center" prop="wordcount" width="120"/>
      <el-table-column label="是否译成外文" align="center" prop="translation" width="120"/>
      <el-table-column label="学校署名" align="center" prop="schoolsignature" width="120"/>
      <el-table-column label="语种" align="center" prop="language" width="120"/>
      <el-table-column label="ISBN号" align="center" prop="isbnnumber" width="180"/>
      <el-table-column label="CIP号" align="center" prop="cipnumber" width="180"/>
      <el-table-column label="出版社级别" align="center" prop="publisherlevel" width="120"/>
      <el-table-column label="是否受资助" align="center" prop="funding" width="120"/>
      <el-table-column label="录入人" align="center" prop="inputperson" width="120"/>
      <el-table-column label="录入时间" align="center" prop="entrytime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.entrytime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="简介" align="center" prop="introduction" width="180"/>
      <el-table-column label="新增人" align="center" prop="adduser" width="120"/>
      <el-table-column label="新增时间" align="center" prop="addtime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.addtime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="校级审核人" align="center" prop="schoolauditor" width="120"/>
      <el-table-column label="院系审核人" align="center" prop="facultyauditor" width="120"/>
      <el-table-column label="校级审核时间" align="center" prop="schoolaudittime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.schoolaudittime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="院系审核时间" align="center" prop="facultyauditime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.facultyauditime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="校级审核状态" align="center" prop="schoolauditstatus" width="120"/>
      <el-table-column label="院系审核状态" align="center" prop="facultyauditstatus" width="120"/>
      <el-table-column label="备注" align="center" prop="remark" width="120"/>
      <el-table-column fixed="right" label="附件" align="center" prop="appendix" width="200">
        <template slot-scope="{row}">
          <el-link :href="row.appendix" target="_blank" class="buttonText"  type="primary" :underline="false">{{row.appendix}}</el-link>
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-info"
            @click="handleDetail(scope.row)"
          >详情</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['teacher:book:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['teacher:book:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改著作信息集对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
      <el-form v-bind:disabled="disabled" ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="用户编号" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户编号" />
        </el-form-item>
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="人员编号" prop="a00">
              <el-input v-model="form.a00" placeholder="请输入人员编号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="著作编号" prop="itemnumber">
              <el-input v-model="form.itemnumber" placeholder="请输入著作编号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="著作名称" prop="topic">
              <el-input v-model="form.topic" placeholder="请输入著作名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="第一作者类型" prop="firstauthortype">
              <el-input v-model="form.firstauthortype" placeholder="请输入第一作者类型" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="第一作者" prop="firstauthor">
              <el-input v-model="form.firstauthor" placeholder="请输入第一作者" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所属单位" prop="unit">
              <el-input v-model="form.unit" placeholder="请输入所属单位" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="出版单位" prop="publishunit">
              <el-input v-model="form.publishunit" placeholder="请输入出版单位" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出版时间" prop="issuingtime">
              <el-date-picker clearable size="small"
                              v-model="form.issuingtime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择出版时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="学科门类" prop="subjectcategories">
              <el-input v-model="form.subjectcategories" placeholder="请输入学科门类" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="一级学科" prop="firstleveldiscipline">
              <el-input v-model="form.firstleveldiscipline" placeholder="请输入一级学科" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="项目来源" prop="projectsource">
              <el-input v-model="form.projectsource" placeholder="请输入项目来源" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="总字数" prop="wordcount">
              <el-input v-model="form.wordcount" placeholder="请输入总字数" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="是否译成外文" prop="translation">
              <el-input v-model="form.translation" placeholder="请输入是否译成外文" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="学校署名" prop="schoolsignature">
              <el-input v-model="form.schoolsignature" placeholder="请输入学校署名" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="语种" prop="language">
              <el-input v-model="form.language" placeholder="请输入语种" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="ISBN号" prop="isbnnumber">
              <el-input v-model="form.isbnnumber" placeholder="请输入ISBN号" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="CIP号" prop="cipnumber">
              <el-input v-model="form.cipnumber" placeholder="请输入CIP号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出版社级别" prop="publisherlevel">
              <el-input v-model="form.publisherlevel" placeholder="请输入出版社级别" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="是否受资助" prop="funding">
              <el-input v-model="form.funding" placeholder="请输入是否受资助" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="录入人" prop="inputperson">
              <el-input v-model="form.inputperson" placeholder="请输入录入人" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="录入时间" prop="entrytime">
              <el-date-picker clearable size="small"
                              v-model="form.entrytime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择录入时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="简介" prop="introduction">
              <el-input v-model="form.introduction" placeholder="请输入简介" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="新增人" prop="adduser">
              <el-input v-model="form.adduser" placeholder="请输入新增人" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="新增时间" prop="addtime">
              <el-date-picker clearable size="small"
                              v-model="form.addtime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择新增时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="校级审核人" prop="schoolauditor">
              <el-input v-model="form.schoolauditor" placeholder="请输入校级审核人" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="院系审核人" prop="facultyauditor">
              <el-input v-model="form.facultyauditor" placeholder="请输入院系审核人" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="校级审核时间" prop="schoolaudittime">
              <el-date-picker clearable size="small"
                              v-model="form.schoolaudittime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择校级审核时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="院系审核时间" prop="facultyauditime">
              <el-date-picker clearable size="small"
                              v-model="form.facultyauditime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择院系审核时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="校级审核状态" prop="schoolauditstatus">
              <el-input v-model="form.schoolauditstatus" placeholder="请输入校级审核状态" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="院系审核状态" prop="facultyauditstatus">
              <el-input v-model="form.facultyauditstatus" placeholder="请输入院系审核状态" />
            </el-form-item>
          </el-col>
        </el-row>
<!--        <el-form-item label="删除标识" prop="delFlag">-->
<!--          <el-input v-model="form.delFlag" placeholder="请输入删除标识" />-->
<!--        </el-form-item>-->
        <el-row gutter="15">
          <el-col :span="12">
            <el-form-item label="备注" prop="remark">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>
        <el-form-item label="附件">
          <fileUpload v-model="form.appendix"/>
        </el-form-item>
        <el-divider content-position="center">著作作者信息集信息</el-divider>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button v-show="!hidden" type="primary" icon="el-icon-plus" size="mini" @click="handleAddTBookAuthor">添加</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button v-show="!hidden" type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteTBookAuthor">删除</el-button>
          </el-col>
        </el-row>
        <el-table border :data="tbookAuthorList" :row-class-name="rowTBookAuthorIndex" @selection-change="handleTBookAuthorSelectionChange" ref="tBookAuthor">
          <el-table-column type="selection" width="50" align="center" />
<!--          <el-table-column label="序号" align="center" prop="index" width="50"/>-->
<!--          <el-table-column label="著作ID" prop="bookid">-->
<!--            <template slot-scope="scope">-->
<!--              <el-input v-model="scope.row.bookid" placeholder="请输入著作ID" />-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column label="教师ID" prop="a00">-->
<!--            <template slot-scope="scope">-->
<!--              <el-input v-model="scope.row.a00" placeholder="请输入教师ID" />-->
<!--            </template>-->
<!--          </el-table-column>-->
          <el-table-column label="署名顺序" prop="signatureorder">
            <template slot-scope="scope">
              <el-input v-model="scope.row.signatureorder" placeholder="请输入署名顺序" />
            </template>
          </el-table-column>
          <el-table-column label="作者类型" prop="authortype" width="100">
            <template slot-scope="scope">
              <el-input v-model="scope.row.authortype" placeholder="请输入作者类型" />
            </template>
          </el-table-column>
          <el-table-column label="作者姓名" prop="authorname" width="100">
            <template slot-scope="scope">
              <el-input v-model="scope.row.authorname" placeholder="请输入作者姓名" />
            </template>
          </el-table-column>
          <el-table-column label="性别" prop="a0104">
            <template slot-scope="scope">
              <el-input v-model="scope.row.a0104" placeholder="请输入性别" />
            </template>
          </el-table-column>
          <el-table-column label="学历" prop="a0801" width="130">
            <template slot-scope="scope">
              <el-input v-model="scope.row.a0801" placeholder="请输入学历" />
            </template>
          </el-table-column>
          <el-table-column label="专业技术资格名称" prop="a0601" width="130">
            <template slot-scope="scope">
              <el-input v-model="scope.row.a0601" placeholder="请输入专业技术资格名称" />
            </template>
          </el-table-column>
          <el-table-column label="工作单位" prop="workunit" width="150">
            <template slot-scope="scope">
              <el-input v-model="scope.row.workunit" placeholder="请输入工作单位" />
            </template>
          </el-table-column>
          <el-table-column label="承担角色" prop="asrole">
            <template slot-scope="scope">
              <el-input v-model="scope.row.asrole" placeholder="请输入承担角色" />
            </template>
          </el-table-column>
          <el-table-column label="参编字数" prop="writewordcount">
            <template slot-scope="scope">
              <el-input v-model="scope.row.writewordcount" placeholder="请输入参编字数" />
            </template>
          </el-table-column>
          <el-table-column label="贡献率" prop="contributionrate">
            <template slot-scope="scope">
              <el-input v-model="scope.row.contributionrate" placeholder="请输入贡献率" />
            </template>
          </el-table-column>
          <el-table-column label="备注" prop="remark">
            <template slot-scope="scope">
              <el-input v-model="scope.row.remark" placeholder="请输入备注" />
            </template>
          </el-table-column>
<!--          <el-table-column label="论文信息标识" prop="essayflag">-->
<!--            <template slot-scope="scope">-->
<!--              <el-input v-model="scope.row.essayflag" placeholder="请输入论文信息标识" />-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column label="著作信息标识" prop="writingsflag">-->
<!--            <template slot-scope="scope">-->
<!--              <el-input v-model="scope.row.writingsflag" placeholder="请输入著作信息标识" />-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column label="课题信息标识" prop="subjectflag">-->
<!--            <template slot-scope="scope">-->
<!--              <el-input v-model="scope.row.subjectflag" placeholder="请输入课题信息标识" />-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column label="著作权信息标识" prop="copyrightflag">-->
<!--            <template slot-scope="scope">-->
<!--              <el-input v-model="scope.row.copyrightflag" placeholder="请输入著作权信息标识" />-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column label="获奖信息标识" prop="awardflag">-->
<!--            <template slot-scope="scope">-->
<!--              <el-input v-model="scope.row.awardflag" placeholder="请输入获奖信息标识" />-->
<!--            </template>-->
<!--          </el-table-column>-->
        </el-table>
      </el-form>
      <div v-show="!hidden" slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listBook, getBook, delBook, addBook, updateBook, exportBook } from "@/api/teacher/book";
import FileUpload from '@/components/FileUpload';

export default {
  name: "Book",
  components: {
    FileUpload,
  },
  data() {
    return {
      hidden: false,
      //禁用状态
      disabled: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 子表选中数据
      checkedTBookAuthor: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 著作信息集表格数据
      bookList: [],
      // 著作作者信息集表格数据
      tbookAuthorList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询著作信息集列表 */
    getList() {
      this.loading = true;
      listBook(this.queryParams).then(response => {
        this.bookList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        recordid: null,
        a00: null,
        userId: null,
        itemnumber: null,
        deptId: null,
        topic: null,
        firstauthortype: null,
        firstauthor: null,
        unit: null,
        publishunit: null,
        issuingtime: null,
        subjectcategories: null,
        firstleveldiscipline: null,
        projectsource: null,
        wordcount: null,
        translation: null,
        schoolsignature: null,
        language: null,
        isbnnumber: null,
        cipnumber: null,
        publisherlevel: null,
        funding: null,
        inputperson: null,
        entrytime: null,
        introduction: null,
        adduser: null,
        addtime: null,
        schoolauditor: null,
        facultyauditor: null,
        schoolaudittime: null,
        facultyauditime: null,
        schoolauditstatus: null,
        facultyauditstatus: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        delFlag: null,
        remark: null,
        appendix: null
      };
      this.tbookAuthorList = [];
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.recordid)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加著作信息集";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.disabled = false
      this.hidden = false;
      this.reset();
      const recordid = row.recordid || this.ids
      getBook(recordid).then(response => {
        this.form = response.data;
        this.tbookAuthorList = response.data.tbookAuthorList;
        this.open = true;
        this.title = "修改著作信息集";
      });
    },
    /** 详情按钮操作 */
    handleDetail(row) {
      this.hidden = true;
      this.disabled = true;
      this.reset();
      const recordid = row.recordid || this.ids
      getBook(recordid).then(response => {
        this.form = response.data;
        this.tbookAuthorList = response.data.tbookAuthorList;
        this.open = true;
        this.title = "修改著作信息集";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.tbookAuthorList = this.tbookAuthorList;
          if (this.form.recordid != null) {
            updateBook(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBook(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const recordids = row.recordid || this.ids;
      this.$confirm('是否确认删除著作信息集编号为"' + recordids + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delBook(recordids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
	/** 著作作者信息集序号 */
    rowTBookAuthorIndex({ row, rowIndex }) {
      row.index = rowIndex + 1;
    },
    /** 著作作者信息集添加按钮操作 */
    handleAddTBookAuthor() {
      let obj = {};
      obj.bookid = "";
      obj.a00 = "";
      obj.signatureorder = "";
      obj.authortype = "";
      obj.authorname = "";
      obj.a0104 = "";
      obj.a0801 = "";
      obj.a0601 = "";
      obj.workunit = "";
      obj.asrole = "";
      obj.writewordcount = "";
      obj.contributionrate = "";
      obj.remark = "";
      obj.essayflag = "";
      obj.writingsflag = "";
      obj.subjectflag = "";
      obj.copyrightflag = "";
      obj.awardflag = "";
      this.tbookAuthorList.push(obj);
    },
    /** 著作作者信息集删除按钮操作 */
    handleDeleteTBookAuthor() {
      if (this.checkedTBookAuthor.length == 0) {
        this.$alert("请先选择要删除的著作作者信息集数据", "提示", { confirmButtonText: "确定", });
      } else {
        this.tbookAuthorList.splice(this.checkedTBookAuthor[0].index - 1, 1);
      }
    },
    /** 单选框选中数据 */
    handleTBookAuthorSelectionChange(selection) {
      if (selection.length > 1) {
        this.$refs.tBookAuthor.clearSelection();
        this.$refs.tBookAuthor.toggleRowSelection(selection.pop());
      } else {
        this.checkedTBookAuthor = selection;
      }
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有著作信息集数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportBook(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
